<?php
/*
 * Created on Jun 1, 2011
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
//$output = '';
//
//for ($i=0;$i<10;$i++) {
//    $output .= 'Loop'.$i.' ';
//    echo $output;
//}

//echo phpinfo();
//$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
//echo $DOCUMENT_ROOT

$count = count($_POST);
if($count != 0)
{
 echo $_POST['Name'];
 echo   " <br> ";
 echo $_POST['CoordinateX'];
 echo   " <br> ";
 echo $_POST['CoordinateY'];
}

//$mysql = mysql_connect("localhost","root","Philips1");
//mysql_select_db("srcar",$mysql);
//$result = mysql_query("SELECT * FROM persons",$mysql);
//printf("First Name: %s<br>\n", mysql_result($result,0,"Name"));
//printf("Last Name: %s<br>\n", mysql_result($result,0,"CoordinateX"));
//printf("Address: %s<br>\n", mysql_result($result,0,"CoordinateY"));


 
$mysql = new SaeMysql();

//
//$sql = "DROP TABLE Persons";
//$mysql->runSql( $sql );
//
//
//$sql = "CREATE TABLE Persons 
//(
//Name varchar(15),
//CoordinateX int,
//CoordinateY int
//)";
//$mysql->runSql( $sql );
//
//$sql =  "INSERT INTO Persons (Name, CoordinateX, CoordinateY) 
//VALUES ('Peter', '10', '20')";
//$mysql->runSql( $sql );

$sql = "SELECT * FROM `Persons` LIMIT 10";
$data = $mysql->getData( $sql );

$count = count($data);
 printf("users count is: %s<br />", $count);

for($i = 0;$i < count($data); $i++)
{
	foreach ($data[$i] as $item)
	{
	  printf("%s<br />", $item);
	}
}

$mysql->closeDb();

?>
